<?php
$funcytheme = "skin-lion";
$uitheme = "redmond";
?>
<html>
	<head>
		<meta charset="utf-8"/>
		<script src="./js/jquery.js"></script>
		<!--jquery UI-->
		<link rel="stylesheet" href="./css/uitheme/<?php echo $uitheme ?>/jquery-ui.css"/>
		<link rel="stylesheet" href="./css/uitheme/<?php echo $uitheme ?>/jquery-ui.structure.css"/>
		<link rel="stylesheet" href="./css/uitheme/<?php echo $uitheme ?>/jquery-ui.theme.css"/>
		<script src="./js/jquery-ui.js"></script>



		<!--Tree-->
		<link rel="stylesheet" href="./css/<?php echo $funcytheme ?>/ui.fancytree.css"/>
		<script src="./js/jquery.fancytree.js"></script>
		<!--grid-->
		<link rel="stylesheet" href="./css/ui.bootstrap.jqgrid.css"/>
		<link rel="stylesheet" href="./css/ui.jqgrid.css"/> 
		<script src="./js/jqgrid-i18n/grid.locale-ru.js"></script>
		<script src="./js/jquery.jqGrid.js"></script>

<!--		<script src="./js/ui.custom.combobox.js"></script>-->
		
		<script src="./js/common.js"></script>


		<script>
			$(document).ready(function () {
				$(".navpane").resizable({
					handles: "e",
					helper: "ui-resizable-helper",
					//ghost:true,
					stop: function (e, ui) {
						//onWindowResize()
						
						var ct=$(".contentRoot")
						ct.css("padding-left", ui.size.width);
						
						$("#content_table").setGridWidth(ct.width()-ui.size.width*0-3)
					}
				})
				
				$(window).resize(onWindowResize)
			}
			);
		</script>
		<!--style>
			.custom-combobox {
				position: relative;
				display: inline-block;
			}
			.custom-combobox-toggle {
				position: absolute;
				top: 0;
				bottom: 0;
				margin-left: -1px;
				padding: 0;
			}
			.custom-combobox-input {
				margin: 0;
				padding: 5px 10px;
			}
		</style-->
		<style>
		 .ui-resizable-helper { border-right: 2px solid grey; }
			.header{
				border-bottom:1px solid lightgrey;
			}
			.contentRoot{
				position:relative;
				padding-left:200px;
				border-bottom:2px solid lightblue;
				border-left:2px solid lightblue;
			}
			.contentpane{
				width:100%;
				min-height:300px;
				background-color:lightgrey;
				border-left:2px solid lightblue;
				//text-align:center;

			}
			.navpane{
				width:200px;
				height:300px;
				position:absolute;
				//background-color:yellow;
				top:0;
				left:0;

			}
			ul.fancytree-container{
				border:0;
			}
		</style>
	</head>
	<body>
		<div class="header" style="height: 70px;overflow: auto;padding: 5px">
			TODO:<br>
			Группировку<br>
			мобильную версию<br>
			формрование отчета (PDF)<br>
			сессии и различные пользователи<br>
			копирование планов<br>
			<?php

foreach (getallheaders() as $name => $value) {
   // echo "$name: $value\n<br>";
}
require_once 'lib/3rdparty/Mobile_Detect.php';
$detect = new Mobile_Detect;
echo "isMobile=".$detect->isMobile()
?>
	
		</div>
		<div class="contentRoot">
			<div class="navpane">
		
	    <?php include "pane_tree.php" ?>
			</div>

			<div class="contentpane"><?php
				if (isset($content_data))
					include $content_data["content_page"];
				else {
					?>
					<div style="font-size:20pt;padding:20px"> Welcome to Shopping list!!!!</div>
					<?php
				}
				?></div>
		</div>
		<?php
//http://php.net/manual/ru/book.mysqli.php
/*		$mysqli = new mysqli("localhost", "root", "", "shopping_plan");
		if ($mysqli->connect_errno) {
			echo "Не удалось подключиться к MySQL: " . $mysqli->connect_error;
		}

		$res = $mysqli->query("SELECT 'choices to xxx please everybody.' AS _msg FROM DUAL");
		$row = $res->fetch_assoc();*/
//echo $row['_msg'];
		?>
	<script>
	$(document).ready(onWindowResize)
	</script>
	</body>
</html>